<?php
/**
 * sablony View for Ohlasky Component
 * @license		GNU/GPL
 */

// No direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view' );

/**
 * sablony View
 *
 */
class OhlaskysViewSablony extends JView
{
	/**
	 * display method of sablony view
	 * @return void
	 **/
	function display($tpl = null)
	{
		//get the sablony
		$sablony		=& $this->get('Data');
		$isNew		= ($sablony->id < 1);
        $nazev = $sablony->nazev;
		$text = $isNew ? JText::_('Nová') : JText::_( $nazev );
		JToolBarHelper::title(   JText::_('Šablony').': <small><small>['.$text.']</small></small>' );
		JToolBarHelper::save();
		if ($isNew)  {
			JToolBarHelper::cancel();
		} else {
			// for existing items the button is renamed `close`
            JToolBarHelper::deleteList();
			JToolBarHelper::cancel( 'cancel', 'Close' );
		}

		$this->assignRef('sablony',	$sablony);

		parent::display($tpl);
	}
}

